package com.yxw.broadcastreceiverdemo;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


    }

    public void doClick(View view){
        switch (view.getId()){
            case R.id.send1:
                Intent intent=new Intent();
                intent.putExtra("msg","这是一条普通广播");

                intent.setAction("BC_One");
                sendBroadcast(intent);
                break;
                default:
                    break;
        }
    }
}
